import { DomWarBeaBaseListPannel } from "./DomWarBeaBaseListPannel";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { ObjCreate } from "../../common/ObjCreate";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { UnionInviteInfoCellRender } from "./UnionInviteInfoCellRender";
import { Cache } from "../../../cache/Cache";
import { UnionInviteCellRender } from "./UnionInviteCellRender";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class UnionInvoteInfoPannel
    
    export  class UnionInvoteInfoPannel extends DomWarBeaBaseListPannel
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            var loc1=33;
            ObjCreate.createGTextField(Language.getString(90650), 30, loc1, 150, 20, this, GlobalStyle.textFormat6);
            this._powerTxt = ObjCreate.createGTextField(Language.getString(90628), 325, loc1, 60, 20, this, GlobalStyle.textFormat6);
            this._opTxt = ObjCreate.createGTextField(Language.getString(20939), 470, loc1, 60, 20, this, GlobalStyle.textFormat6);
            this._cellList.move(23, 64);
            return;
        }

        public /* override */ update(arg1: Object, ... rest): void
        {
            var loc2=0;
            var loc1=arg1.type;
            if (loc1 != 1) 
            {
                if (loc1 == 2) 
                {
                    this._cellList.setStyle("cellRenderer", UnionInviteInfoCellRender);
                    this._powerTxt.visible = false;
                    this.setSize(850, 460);
                    this.header.width = 815;
                    this.title = Language.getString(90656);
                    this._cellList.columnWidth = 780;
                    this._cellList.setSize(780, 370);
                    this._opTxt.x = 731;
                    _pageSelector.x = 380;
                    if (Cache.instance.dominionBea.inviteInfo) 
                    {
                        this._allData = Cache.instance.dominionBea.inviteInfo.seqInvite;
                    }
                }
            }
            else 
            {
                this._cellList.setStyle("cellRenderer", UnionInviteCellRender);
                this._powerTxt.visible = true;
                this.setSize(540, 460);
                this.header.width = 505;
                this.title = Language.getString(90635);
                this._cellList.columnWidth = 510;
                this._cellList.setSize(510, 370);
                this._opTxt.x = 451;
                _pageSelector.x = 231;
                this._allData = arg1.data as Array<any>;
            }
            if (this._allData) 
            {
                loc2 = this._cellList.rowCount * this._cellList.columnCount;
                _pageSelector.maxPage = Math.ceil(this._allData.length / loc2);
                this._pageSelector.currentPage = 1;
                this.updatePageData();
            }
            return;
        }

        /* internal */ /* var */_powerTxt: GTextFiled;

        /* internal */ /* var */_opTxt: GTextFiled;
    }
